<div id="header">
  <div class="wrap">
    <div class="logo"><a href="/"><img src="/static/theme/vnet/images/logo.gif" alt="首页" /></a></div>
    <div class="mainNav">
      <ul class="main">
        <li {% if main_active == "index" %}class="active"{% endif %}>
          <a href="/">首页</a>
        </li>
		<li {% if main_active == "game" %}class="active"{% endif %}>
          <a href="/game/">游戏</a>
        </li>
      </ul>
      <ul class="sub">
        <li class="first"><a href="/help/">帮助中心</a></li>
        {% if not request.user %}
          <li><a href="/reg/?to={{ request.r_url }}">注册</a></li>
          <li><a href="javascript:;" onclick="User.login();">登录</a></li>
        {% else %}
          <li>
            <a href="/user/" class="user">设置</a>
            <a href="/user/mail/recv/"{% if request.has_mails %}  class="newMsg"{% endif %}>消息</a>
          </li>
          <li>
          {% if request.perm_ids and request.perm_ids|length > 0 %}
            <a href="/admin/" target="_blank">管理</a>
          {% endif %}
          <a href="javascript:;" onclick="User.logout();">退出</a>
          </li>
        {% endif %}
      </ul>
    </div>
    <div class="searchBox">
      <form id="g_search" method="post" action="/search/">
        <input id="s_word" name="s_word" type="text" class="inputbox" />
        <input type="submit" class="button btns" value="搜索" />
      </form>
    </div>
  </div>
</div>
